home *** CD-ROM | disk | FTP | other *** search
/ Netware Super Library / Netware Super Library.iso / timevent / taskmstr / procutil.tsk < prev    next >
Encoding:
Text File  |  1995-05-07  |  4.7 KB  |  109 lines

  1. // First check to see if MONITOR.NLM is loaded.  If so, reload MONITOR
  2. // with the -P option so we can access Processor Utilization details.
  3.  
  4. IF LOADED MONITOR.NLM THEN UNLOAD MONITOR
  5.  
  6. LOAD MONITOR -P
  7.  
  8. // We need to check for success in loading MONITOR since the rest of
  9. // this batch job is useless without it.
  10.  
  11. IF ERRORLEVEL THEN ABORT
  12.  
  13.  
  14. // Now check if the active console screen displayed is the "Monitor Screen".
  15. // (Note: The active screen name can be determined by pressing the Alt key
  16. // on the server console.)  Since we loaded MONITOR then the active console
  17. // screen should be the "Monitor Screen".  However, this test will insure
  18. // that the "Monitor Screen" is the active console screen, just in case.
  19.  
  20. IF NOT CURRENT_SCREEN "Monitor Screen" THEN CHANGE_SCREEN "Monitor Screen"
  21.  
  22.  
  23. // Before we proceed much further, we want to make sure that any snapshots
  24. // we take are written to a specific directory.  Therefore, we should set
  25. // the Current Working Directory (CWD) using the CD batch command.  CD
  26. // can be used with a specific destination directory (e.g., SYS:\HOME\SUPER)
  27. // or a relative directory (e.g., ..\NEW_DIR).  It is best to set the
  28. // initial CWD to a specific destination directory in order to assure the
  29. // validity of subsequent relative directory changes.
  30.  
  31. DEFINE %0 %CWD%                                 ; save the current CWD
  32.  
  33. CD SYS:\HOME\SUPER                              ; set the initial CWD
  34.  
  35.  
  36. // At this point, we will assume that this batch file was initiated as
  37. // a result of a CPU utilization threshold alarm action by some network
  38. // management package.  Ideally, we would like to isolate the cause of
  39. // the high utilization.  To help in this quest, we will capture some
  40. // screen data from the MONITOR NLM for later reference.
  41.  
  42. // The first step is to select the Processor Utilization option from
  43. // the main menu, use the F3 key to list all active processes, and scroll
  44. // through each page of active processes, capturing the screen data into
  45. // text files for later review.  Hopefully, this will help us identify
  46. // which server process may be negatively impacting the server.
  47.  
  48. KEYIN "Pro" ENTER                               ; Processor Utilization menu
  49.  
  50. KEYIN F3                                        ; List all active processes
  51.  
  52. WAIT 1                                          ; Give it time to collect data
  53.  
  54. SAVE_SCREEN PROCUTIL.PG1                        ; save text screen image in CWD
  55.  
  56. KEYIN PGDN                                      ; next page of active processes
  57.  
  58. WAIT 1                                          ; Give it time to collect data
  59.  
  60. SAVE_SCREEN PROCUTIL.PG2                        ; save text screen image in CWD
  61.  
  62. KEYIN PGDN                                      ; next page of active processes
  63.  
  64. WAIT 1                                          ; Give it time to collect data
  65.  
  66. SAVE_SCREEN PROCUTIL.PG3                        ; save text screen image in CWD
  67.  
  68. KEYIN PGDN                                      ; next page of active processes
  69.  
  70. WAIT 1                                          ; Give it time to collect data
  71.  
  72. SAVE_SCREEN PROCUTIL.PG4                        ; save text screen image in CWD
  73.  
  74. KEYIN ESC                                       ; to Process Utilization menu
  75.  
  76. KEYIN ESC                                       ; to Main menu
  77.  
  78.  
  79. // Note: Specific processes can be review individually by specifying a
  80. // unique starting portion, or all, of the exact process name as follows:
  81.  
  82. // KEYIN "Polling Proc" F5                      ; for the Polling Process
  83. // KEYIN "Server 01 Pro" F5                     ; for the Server 01 Process
  84. // KEYIN "Server 02 Pro" F5                     ; for the Server 01 Process
  85. // KEYIN ENTER                                  ; to show the selected processes
  86. // WAIT 1                                       ; Give it time to collect data
  87. // SAVE_SCREEN PROCUTIL.SEL                     ; save text screen image in CWD
  88.  
  89.  
  90. // The next step is to take a snapshot of the Resource Utilization info.
  91.  
  92. KEYIN "Res" ENTER                               ; select Resource Utilization
  93.  
  94. SAVE_SCREEN RESOURCE.PG1                        ; save text screen image in CWD
  95.  
  96. KEYIN ESC                                       ; to Main menu
  97.  
  98.  
  99. // Hopefully, the list of active processes and resource usage will help
  100. // identify the source of the excessive CPU utilization.  By returning
  101. // MONITOR to the Main menu, we have reduced its impact on the CPU.
  102. // However, to further minimize CPU load and maximize available Cache
  103. // Buffers, we should go ahead and unload MONITOR.
  104.  
  105. UNLOAD MONITOR
  106.  
  107. CD %0                                           ; restore the original CWD
  108.  
  109.